package com.hellobike.haxing.modules.order.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import com.hellobike.haxing.modules.order.entity.OrderB;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @Description: B端订单
 * @Author: haxing-boot
 * @Date:   2020-02-08
 * @Version: V1.0
 */
public interface OrderBMapper extends BaseMapper<OrderB> {
    /**
     * 更新订单状态
     * @param orderId
     * @param status
     */
    @Update("update t_order_b set bstatus=#{status},update_time=now() where order_id=#{orderId} and deleted=0")
    void updateOrderBStatus(@Param("orderId")Long orderId, @Param("status")Integer status);

    /**
     * 修改订单已完成
     * @param ids
     */
    void updateFinishOrder(@Param("ids")List<Long> ids);

    /**
     * 获取B端订单信息
     *
     * @param orderId
     * @return
     */
    @Select("select * from t_order_b where order_id=#{orderId} and deleted=0")
    OrderB getOrderB(Long orderId);
}
